import { GlobalStyle } from "../../../../common/global/GlobalStyle";
import { Language } from "../../../../../extend/language/Language";
import { FilterConst } from "../../../../component/gconst/FilterConst";
import { GlobalClass } from "../../../../../com/mui/core/GlobalClass";
import { ImagesConst } from "../../../resource/ImagesConst";
import { OpenServerRewardBody } from "./OpenServerRewardBody";
import { GBoxDirection } from "../../../../../com/mui/containers/globalVariable/GBoxDirection";
import { GScrollPane } from "../../../../../com/mui/controls/GScrollPane";
import { ScrollPolicy } from "../../../../../fl/controls/ScrollPolicy";
import { DailySpecialInfo } from "../../../model/DailySpecialInfo";
type int = number;
//class SpecialRewardList
    
    export  class SpecialRewardList /* flash.display.Sprite */
    {
        constructor(arg1: int, arg2: int)
        {
            
            this._width = arg1;
            this._height = arg2;
            this.initUI();
            return;
        }

        protected initUI(): void
        {
            this._conditionTxt = new Object /* flash.text.TextField */();
            this._conditionTxt.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this._conditionTxt.mouseEnabled = false;
            this._conditionTxt.textColor = GlobalStyle.color2Uint;
            this._conditionTxt.width = 30;
            this._conditionTxt.height = 18;
            this._conditionTxt.text = Language.getString(20937);
            this._conditionTxt.x = 55;
            this._conditionTxt.filters = [FilterConst.nameGlowFilter];
            addChild(this._conditionTxt);
            this._rewardTxt = new Object /* flash.text.TextField */();
            this._rewardTxt.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this._rewardTxt.mouseEnabled = false;
            this._rewardTxt.textColor = GlobalStyle.color2Uint;
            this._rewardTxt.width = 30;
            this._rewardTxt.height = 18;
            this._rewardTxt.text = Language.getString(20938);
            this._rewardTxt.x = 210;
            this._rewardTxt.filters = [FilterConst.nameGlowFilter];
            addChild(this._rewardTxt);
            this._optTxt = new Object /* flash.text.TextField */();
            this._optTxt.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this._optTxt.mouseEnabled = false;
            this._optTxt.textColor = GlobalStyle.color2Uint;
            this._optTxt.width = 30;
            this._optTxt.height = 18;
            this._optTxt.text = Language.getString(20939);
            this._optTxt.x = 370;
            this._optTxt.filters = [FilterConst.nameGlowFilter];
            addChild(this._optTxt);
            this._line = GlobalClass.getBitmap(ImagesConst.SplitLine);
            this._line.width = this.width;
            this._line.y = 25;
            addChild(this._line);
            this._rewardBody = new OpenServerRewardBody();
            this._rewardBody.direction = GBoxDirection.VERTICAL;
            this._rewardBody.verticalGap = 0;
            this._scrollPane = new GScrollPane();
            this._scrollPane.x = 0;
            this._scrollPane.y = this._line.y + this._line.height;
            this._scrollPane.width = this.width;
            this._scrollPane.height = this.height - this._line.y;
            this._scrollPane.styleName = "GScrollPane";
            this._scrollPane.verticalScrollPolicy = ScrollPolicy.AUTO;
            this._scrollPane.horizontalScrollPolicy = ScrollPolicy.OFF;
            this._scrollPane.source = this._rewardBody;
            this._scrollPane.scrollDrag = false;
            this._scrollPane.focusEnabled = false;
            addChild(this._scrollPane);
            return;
        }

        public updateData(arg1: DailySpecialInfo): void
        {
            var loc1=0;
            this._rewardBody.disposeChild();
            var loc2=arg1.rewardDataList.length;
            while (loc1 < loc2) 
            {
                this._rewardBody.addItem(arg1, loc1);
                ++loc1;
            }
            this._rewardBody.invalidate();
            this._scrollPane.refreshPane();
            this._scrollPane.update();
            return;
        }

        public onGetRewardRes(arg1: int, arg2: int): void
        {
            this._rewardBody.onGetRewardRes(arg1, arg2);
            return;
        }

        public onActiveConditionUpdate(arg1: Array<any>): void
        {
            this._rewardBody.onActiveConditionUpdate(arg1);
            return;
        }

        public updataGetRewardState(arg1: Array<any>): void
        {
            this._rewardBody.updataGetRewardState(arg1);
            return;
        }

        public dispose(): void
        {
            this._rewardBody.disposeChild();
            return;
        }

        public /* override */ get height(): number
        {
            return this._height;
        }

        public /* override */ get width(): number
        {
            return this._width;
        }

        /* internal */ /* var */_conditionTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_rewardTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_optTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_line: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_scrollPane: GScrollPane;

        /* internal */ /* var */_rewardBody: OpenServerRewardBody;

        /* internal */ /* var */_height: int;

        /* internal */ /* var */_width: int;
    }
